package com.gw.vip.server.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gw.vip.server.po.SysArg;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author GW
 * @description
 * @since 2022-05-04
 */
public interface SysArgMapper extends BaseMapper<SysArg> {
    /**
     * 更新系统参数
     * @param sysArgId
     * @param argValue
     * @return
     */
    @Update("UPDATE sys_arg SET arg_value=#{argValue}, upd_time=NOW() WHERE id=#{sysArgId}")
    int updateValue(String sysArgId, String argValue);

    /**
     * 根据id获取值
     * @param id
     * @return
     */
    @Select("SELECT arg_value FROM sys_arg WHERE id=#{id}")
    String valueById(String id);
}
